﻿using MvcApplication1.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace MvcApplication1.Controllers
{
    public class HomeController : Controller
    {
        //
        // GET: /Home/
        static List<Verdura> verduras = new List<Verdura>();

        public ActionResult Index()
        {
            verduras.Add(new Verdura("zanahoria", "tierra", 4));
            verduras.Add(new Verdura("banana", "arbol", 5));
            verduras.Add(new Verdura("cereza", "arbusto", 6));
            verduras.Add(new Verdura("pepe", "magica", 7));
            verduras.Add(new Verdura("papa", "tierra", 3));
            verduras.Add(new Verdura("coco", "palmera", 4));
            verduras.Add(new Verdura("huevo", "magica", 3));

            return View();
        }

        public ActionResult Datos()
        {
            return Json(verduras, JsonRequestBehavior.AllowGet);
        }
    }
}
